Skip to content

Conversation

amandasystems
Copy link
Contributor

@amandasystems amandasystems commented May 7, 2025

Revise the extra r: 'static constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive 'static.

This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that.

The PR was extracted out of #130227 and consists of one-third of its functional payload.

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 7, 2025
@amandasystems amandasystems force-pushed the revised-constraint-search branch from f4af776 to 72e81ea Compare May 16, 2025 10:14
@amandasystems amandasystems force-pushed the revised-constraint-search branch from 72e81ea to 9a1face Compare May 27, 2025 10:09
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@amandasystems amandasystems force-pushed the revised-constraint-search branch from 7902ae9 to 6539053 Compare May 28, 2025 17:05
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 5, 2025

☔ The latest upstream changes (presumably #140466) made this pull request unmergeable. Please resolve the merge conflicts.

@amandasystems amandasystems force-pushed the revised-constraint-search branch from 6539053 to a209255 Compare June 5, 2025 11:13
@amandasystems amandasystems changed the title [WIP] Region inference: Use outlives-static constraints in constraint search Region inference: Use outlives-static constraints in constraint search Jun 9, 2025
@amandasystems
Copy link
Contributor Author

(We may also want a perf run to see if I messed something up badly)

@lcnr
Copy link
Contributor

lcnr commented Jun 9, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2025
bors added a commit that referenced this pull request Jun 9, 2025
Region inference: Use outlives-static constraints in constraint search

Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`.

This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that.

The PR was extracted out of #130227 and consists of one-third of its functional payload. It is based on #140466, so that has to land first.

We probably want a perf run of this. It shouldn't have much of an impact and a positive one if any, but I have been wrong before. In particular, SCC annotations are heavier now.

r? lcnr
@bors
Copy link
Collaborator

bors commented Jun 9, 2025

⌛ Trying commit a209255 with merge 0d3d480...

@bors
Copy link
Collaborator

bors commented Jun 9, 2025

☀️ Try build successful - checks-actions
Build commit: 0d3d480 (0d3d48082efe47a20c953415945cc721105e5f85)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0d3d480): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 12
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.5%] 6
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 12

Max RSS (memory usage)

Results (primary 0.4%, secondary -1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.3%, 1.5%] 2
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
-1.7% [-1.7%, -1.7%] 1
Improvements ✅
(secondary)
-1.9% [-2.4%, -0.6%] 4
All ❌✅ (primary) 0.4% [-1.7%, 1.5%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 753.257s -> 756.017s (0.37%)
Artifact size: 372.34 MiB -> 372.33 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 9, 2025
@amandasystems amandasystems force-pushed the revised-constraint-search branch from a209255 to 335fa61 Compare June 18, 2025 10:21
@amandasystems amandasystems force-pushed the revised-constraint-search branch from 335fa61 to 6a325fd Compare June 27, 2025 15:44
@bors
Copy link
Collaborator

bors commented Aug 21, 2025

☔ The latest upstream changes (presumably #145244) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr
Copy link
Contributor

lcnr commented Aug 22, 2025

needs rebase :>

Revise the extra `r: 'static` constraints added upon universe issues
to add an explanation, and use that explanation during constraint blame
search. This greatly simplifies the region inference logic, which
now does not need to reverse-engineer the event that caused a region
to outlive 'static.
@amandasystems amandasystems force-pushed the revised-constraint-search branch from 08293cc to 7dd56b1 Compare August 22, 2025 11:38
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 25, 2025
rework GAT borrowck limitation error

The old one depends on the `ConstraintCategory` of the constraint which meant we did not emit this note if we had to prove the higher ranked trait bound due to e.g. normalization.

This made it annoying brittle and caused MIR borrowck errors to be order dependent, fixes the issue in rust-lang/rust#140737 (comment).

r? types cc ```@amandasystems```
@lcnr
Copy link
Contributor

lcnr commented Aug 25, 2025

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Aug 25, 2025

📌 Commit ae622bb has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 25, 2025
bors added a commit that referenced this pull request Aug 25, 2025
Region inference: Use outlives-static constraints in constraint search

Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`.

This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that.

The PR was extracted out of #130227 and consists of one-third of its functional payload.

r? lcnr
@bors
Copy link
Collaborator

bors commented Aug 25, 2025

⌛ Testing commit ae622bb with merge 5039e79...

@bors
Copy link
Collaborator

bors commented Aug 25, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 25, 2025
@amandasystems
Copy link
Contributor Author

💔 Test failed - checks-actions

That seems pretty spurious?

@lcnr
Copy link
Contributor

lcnr commented Aug 27, 2025

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2025
@bors
Copy link
Collaborator

bors commented Aug 27, 2025

⌛ Testing commit ae622bb with merge b2dd217...

@bors
Copy link
Collaborator

bors commented Aug 27, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing b2dd217 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 27, 2025
@bors bors merged commit b2dd217 into rust-lang:master Aug 27, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 27, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 4f808ba (parent) -> b2dd217 (this PR)

Test differences

Show 17 test diffs

17 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard b2dd217dd0a099fb87601657ec480bf3e92b30a6 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 7951.7s -> 5817.1s (-26.8%)
  2. aarch64-apple: 6291.0s -> 5039.7s (-19.9%)
  3. x86_64-gnu-llvm-19-1: 3151.8s -> 3626.4s (15.1%)
  4. pr-check-1: 1377.1s -> 1566.8s (13.8%)
  5. aarch64-gnu-debug: 4228.9s -> 4806.5s (13.7%)
  6. dist-x86_64-apple: 7135.3s -> 8068.7s (13.1%)
  7. x86_64-gnu-llvm-19: 2458.6s -> 2770.9s (12.7%)
  8. i686-msvc-2: 7715.8s -> 8490.5s (10.0%)
  9. x86_64-gnu-distcheck: 5083.6s -> 5510.5s (8.4%)
  10. test-various: 4664.6s -> 5047.5s (8.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b2dd217): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.4%] 13
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 6
All ❌✅ (primary) 0.2% [0.1%, 0.4%] 13

Max RSS (memory usage)

Results (primary 0.3%, secondary -3.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-4.3% [-5.2%, -2.9%] 5
All ❌✅ (primary) 0.3% [-0.9%, 1.5%] 2

Cycles

Results (secondary 2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.3%, 3.4%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.222s -> 468.683s (0.31%)
Artifact size: 391.17 MiB -> 391.17 MiB (-0.00%)

@amandasystems amandasystems deleted the revised-constraint-search branch August 27, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants